Set endianness before marching on.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 23 Sep 2002 20:02:40 +0000 (20:02 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 23 Sep 2002 20:02:40 +0000 (20:02 +0000)
gpsbabel/psp.c

index 85b6a4898d13e997f53953e4c07c1294a29b7b80..4c59e66fc7459c303886eb0c43a9d17f1d8f69d5 100644 (file)
@@ -73,6 +73,11 @@ psp_fread_double(FILE *fp)
 {
        unsigned char buf[8];
        unsigned char sbuf[8];
+
+       if (!endianness_tested) {
+               test_endianness();
+       }
+
        psp_fread(buf, 1, 8, psp_file_in);
        if (i_am_little_endian) {
                return *(double *) buf;